//获取轮播图
function swiPerS() {
    $.ajax({
        url: "http://localhost:8888/api/swipers",
        success: function (res) {
            let arr = [];
            res.data.forEach(item => {
                arr.push(`<li class="img-effect">
              <a href="javascript:;">
                <img src="./uploads/${item.swiperimg}" alt="">
              </a>
            </li>`);
            })
            $("ul[carousel-item]").html(arr.join(""));
        }
    })
}

// 友情链接
function links() {
    $.ajax({
        url: "http://localhost:8888/api/links",
        success: function (res) {
            let arr = ["<dt>合作伙伴</dt>"];
            res.data.forEach(item => {
                arr.push(`<dd>
              <a href="${item.linkurl}">
                <img src="./uploads/${item.linkicon}" alt="">
              </a>
            </dd>`)
            });
            $(".kr_collaborator").html(arr.join(""));
        }
    })
}

swiPerS();
links();

